#pragma once

#include <iostream>
#include <vector>
#include <algorithm>
#include <bitset>
#include "AbstractGraph.h"

namespace {

	class ListGraph : public AbstractGraph{
	private:
		std::vector<std::vector<int> > listOfAdjacents_;
	public:
		void readGraph(int vertexNum, int edgesNum, const std::vector<std::pair<int, int> >& edgesList){
			setVertexNum(vertexNum);
			setEdgesNum(edgesNum);
			listOfAdjacents_.resize(getVertexNum());
			for (int edgesNum = 0; edgesNum < getEdgesNum(); ++edgesNum){
				int fromVertex = edgesList[edgesNum].first;
				int toVertex = edgesList[edgesNum].second;
				listOfAdjacents_[fromVertex].push_back(toVertex);
			}
		}
		std::vector<int> getAdjacentList(int inputVertex){
			return listOfAdjacents_[inputVertex];
		}
		virtual ~ListGraph(){}
	};
}


